//
//  AppManager.m
//  TooToo
//
//  Created by liuning on 15/8/18.
//  Copyright (c) 2015年 MoHao. All rights reserved.
//

#import "AppManager.h"

@implementation AppManager

+(instancetype)sharedManager
{
    static dispatch_once_t queue;
    static AppManager * manager = nil;
    
    dispatch_once(&queue, ^{
        manager = [[AppManager alloc]init];
    });
    
    return manager;
}

-(instancetype)init
{
    if (self = [super init]) {
        
        //设置是否首次启动
        NSString * fStr = [[NSUserDefaults standardUserDefaults] objectForKey:@"firstLaunchMark"];
        if (![fStr isEqualToString:@"1"]) {
            
            _isFirstLaunch = YES;
        }
        
        [[NSUserDefaults standardUserDefaults]setObject:@"1" forKey:@"firstLaunchMark"];
        [[NSUserDefaults standardUserDefaults] synchronize];
        
    }
    
    return self;
}

-(void)setNeedPlayBackgroud:(BOOL)needPlayBackgroud
{
    _needPlayBackgroud = needPlayBackgroud;
    
    if (!needPlayBackgroud && self.stopBg) {
        
        self.stopBg();
    }
}

//#pragma mark - 引导页相关
//
//-(BOOL)checkWhetherShowGuideView
//{
//    return ![[NSUserDefaults standardUserDefaults] boolForKey:@"guideViewHasShown"];
//}
//
//-(void)setGuideViewHasShown
//{
//    [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"guideViewHasShown"];
//    [[NSUserDefaults standardUserDefaults] synchronize];
//}
//
//-(void)showGuideViewOnView:(UIView *)view
//{
//    [self setGuideViewHasShown];
//
//    GuideScrollView * gView = [[GuideScrollView alloc]initWithFrame:CGRectMake(0, 0, IPHONEWIDTH, IPHONEHIGHT)];
//    [view addSubview:gView];
//}


@end
